package com.blu.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.beans.factory.annotation.Autowired;

import com.blu.jsoup.MyJsoup;

@PersistJobDataAfterExecution
public class MyJob implements Job{
	
	private Integer count;

	public void setCount(Integer count) {
		this.count = count;
	}

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			MyJsoup myJsoup = new MyJsoup();
			myJsoup.a();
			System.out.println("***************");
		} catch (Exception e) {
			System.out.println("*****error*****");
			e.printStackTrace();
		}
		count++;
		System.out.println(count);
		JobCount.count = this.count;
		context.getJobDetail().getJobDataMap().put("count", count);
	}

}
